package sn.gandal.mobile.kalpet.utils;

import sn.gandal.mobile.kalpet.activities.HistoriqueCouponActivity;
import sn.gandal.mobile.kalpet.activities.KGestionComptes;
import sn.gandal.mobile.kalpet.activities.KGestionVirements;
import android.content.Context;
import android.content.Intent;

public class ActivityUtils {

	
	public static void addMenuAccueilSelectedNameOnBundle(Intent intent, String menuName){
		
		 if(menuName.equalsIgnoreCase(KalpetConstants.GESTION_COMPTES)){					
			  
			  intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KGestionComptes.class );
			  
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_ACHATS)){
			
			
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.GESTION_ACHATS);
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_BONS)){
			
			 
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.GESTION_BONS);
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_HISTORIQUES)){
			
			 
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.GESTION_HISTORIQUES);
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_VENTES)){
			 
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.GESTION_VENTES);
		}else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_VIREMENTS)){
			 
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.GESTION_VIREMENTS);
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.MES_SERVICES)){
			
			 
			 intent.putExtra(KalpetConstants.MENU_ACCUEIL_SELECTED, KalpetConstants.MES_SERVICES);
			 
		}
		else{
			 //TODO voir quel autre cas pourrait se presenter pour le gerer ici
		}
		 
	 }
	
	public static Intent getIntent2Display(Context context, String menuName){
		Intent intent;
		
		if(menuName.equalsIgnoreCase(KalpetConstants.GESTION_COMPTES)){			
			
			  intent = new Intent(context, KGestionComptes.class);		  
			  
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_ACHATS)){
			
			 intent = new Intent(context, KGestionComptes.class);			 
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_BONS)){
			
			 intent = new Intent(context, HistoriqueCouponActivity.class);			 
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_HISTORIQUES)){
			
			 intent = new Intent(context, KGestionComptes.class);			
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_VENTES)){
			 intent = new Intent(context, KGestionComptes.class);
			 
		}
		else if (menuName.equalsIgnoreCase(KalpetConstants.GESTION_VIREMENTS)){
			
			 intent = new Intent(context, KGestionVirements.class);			 
			 
		}else if (menuName.equalsIgnoreCase(KalpetConstants.MES_SERVICES)){
			
			 intent = new Intent(context, KGestionComptes.class);			 
		}
		else{
			 intent=null;
		}
		
		return intent;
		
	}
}
